﻿using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ECSE6770
{
    public partial class EntitiesContainer
    {
        public IQueryable<Module> Modules
        {
            get { return this.Products.OfType<Module>().Where(m => !m.Deleted); }
        }

        public IQueryable<Video> Videos
        {
            get { return this.Products.OfType<Video>().Where(v => !v.Deleted); }
        }

        public void Detach(object entity)
        {
            ((IObjectContextAdapter)this).ObjectContext.Detach(entity);
        }
    }
}